#ifndef EDITSLIDER_H
#define EDITSLIDER_H

#include <QWidget>

namespace Ui {
    class EditSlider;
}

/**
 * @brief Combines a QSlider and QSpinBox into one widget.
 *
*/
class EditSlider : public QWidget
{
    Q_OBJECT

public:
    explicit EditSlider(QWidget *parent = 0);
    ~EditSlider();

    void setRange(int min, int max);
    void setMaximum(int value);
    void setMinimum(int value);
    void setTracking(bool enable);

    float value() const;

private:
    Ui::EditSlider *ui;

private slots:
    void onSliderValueChanged(int value);
    void onSliderPressed();
    void onSliderMoved(int value);
    void onSliderReleased();
    void onSpinBoxValueChanged(int value);
    void onSpinBoxEditingFinished();

public slots:
    void setValue(int value);

signals:
    void valueChanged(int value);
    void sliderPressed();
    void sliderMoved(int value);
    void sliderReleased();

    void editingFinished(int value);
};

#endif // EDITSLIDER_H
